import request from '@/utils/request'
// ========================= 管理 ======================================
// Get Lecture
export const QueryLecture = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/lecture/manage/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// Dispatch Lecture
export const DispatchLecture = (data) => {
  return request({
    url: '/v1/prse/lecture/manage/',
    method: 'post',
    data,
  })
}

// Active Record To Work Lecture
export const ActiveAddLectureRecord = (rid) => {
  return request({
    url: '/v1/prse/lecture/manage/addWorkLecture/',
    method: 'post',
    params: { rid },
  })
}

// ------------------------- 用户 --------------------------------------

// Create My Lecture
export const CreateLecture = (data) => {
  return request({
    url: '/v1/prse/lecture/my/',
    method: 'post',
    data,
  })
}

// Query My Lecture
export const QueryMyLecture = (page, pageSize) => {
  return request({
    url: '/v1/prse/lecture/my/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
    },
  })
}

// Evaluate My Lecture
export const EvaluateMyLecture = (data) => {
  return request({
    url: '/v1/prse/lecture/myEvaluate/',
    method: 'post',
    data,
  })
}

// Preview My Lecture File
export const GetPreviewImages = (lectureId) => {
  return request({
    url: '/v1/prse/lecture/my/dataPreView/',
    method: 'get',
    params: { lecture_id: lectureId },
  })
}

// ============================== 工作者 =========================
// Get Lecture
export const QueryLectureToMe = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/lecture/worker/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// Post Annex File
export const FinishAnnexLectureToMe = (data) => {
  return request({
    url: '/v1/prse/lecture/worker/',
    method: 'post',
    data,
  })
}
